﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MethodKPI.aspx.cs" Inherits="FBKPI.Forms.MethodKPI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" language="javascript">
        $("#divdetailInputUom").hide();
        $("#divdetailInputUom").dialog({
            title: '<span class="header-text">Unit Of Measure Form</span>',
            autoOpen: false,
            width: 600,
            height: 230,
            modal: true,
            resizable: false
        });

        $("#divdetailInputUomDetail").hide();
        $("#divdetailInputUomDetail").dialog({
            title: '<span class="header-text">Unit Of Measure Detail Form</span>',
            autoOpen: false,
            width: 600,
            height: 230,
            modal: true,
            resizable: false
        });

        LoadUom = function () {
         LoadForm('UoMSetupForm.aspx?ID=' + 0, function (result) {
                $("#divdetailInputUom").html(result);
                $("#divdetailInputUom").dialog('open');
            });
        }

        LoadUomDetailMax = function () {
         LoadForm('UoMDetailSetupForm.aspx?ID=' + 0, function (result) {
                $("#divdetailInputUomDetail").html(result);
                $("#divdetailInputUomDetail").dialog('open');
            });
        }

        LoadUomDetailMin = function () {
            LoadForm('UoMDetailSetupForm.aspx?ID=' + 0, function (result) {
                $("#divdetailInputUomDetail").html(result);
                $("#divdetailInputUomDetail").dialog('open');
            });
        }


        //yearly
        $("#btn_BrowseUOMInputYearly").click(function () {
           LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputYearly").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputYearly").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //====

        //==semester 1
        $("#btn_BrowseUOMInputSemester1").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputSemester1").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputSemester1").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==semester 2
        $("#btn_BrowseUOMInputSemester2").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputSemester2").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputSemester2").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Q 1
        $("#btn_BrowseUOMInputQ1").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputQ1").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputQ1").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Q 2
        $("#btn_BrowseUOMInputQ2").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputQ2").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputQ2").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Q 3
        $("#btn_BrowseUOMInputQ3").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputQ3").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputQ3").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Q 4
        $("#btn_BrowseUOMInputQ4").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputQ4").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputQ4").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Triwulan1
        $("#btn_BrowseUOMInputTriwulan1").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputTriwulan1").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputTriwulan1").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Triwulan2
        $("#btn_BrowseUOMInputTriwulan2").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputTriwulan2").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputTriwulan2").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Triwulan3
        $("#btn_BrowseUOMInputTriwulan3").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputTriwulan3").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputTriwulan3").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

        //==Weekly
        $("#btn_BrowseUOMInputWeekly").click(function () {
            LoadUom();
            return false;
        });

        $("#btn_BrowseUOMMaxInputWeekly").click(function () {
            LoadUomDetailMax();
            return false;
        });

        $("#btn_BrowseUOMMinInputWeekly").click(function () {
            LoadUomDetailMin();
            return false;
        });
        //===

    </script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {

            //alert($('#<%= hfKpiId.ClientID %>').val()+"beni");

            BrowseUom = function (method) {

                $("#divBrowseUOM").dialog("option", "title", '<span class="header-text">Select Unit of Measure</span>');
                $("#divBrowseUOM").dialog("open");
                $('#uom').dataTable({
                    "oLanguage": {
                        "sZeroRecords": "No records to display",
                        "sSearch": "Search"
                    },
                    "bSort": false,
                    "bPaginate": true,
                    "bAutoWidth": true,
                    "bProcessing": true,
                    "bServerSide": true,
                    "bDestroy": true,
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers",
                    "bDeferRender": true,
                    "fnServerData": function (sSource, aoData, fnCallback) {
                        $.ajax({
                            "dataType": 'json',
                            "type": "GET",
                            "url": "../Serializer/UoMSerializer.ashx",
                            "data": aoData,
                            "success": fnCallback
                        });
                    },
                    "aoColumns": [
                        { "mData": "No" },
                        { "mData": "Description" },
                        { "mData": "isActive" },
                        { "mData": "ID" }
                    ],
                    "aoColumnDefs":
                    [
                        { "fnRender":
                            function (oObj) {
                                //alert(method);
                                return "<a href=\"#\" onclick=\"PickUOM('" + oObj.aData["ID"] + "','" + oObj.aData["Description"] + "','" + method + "')\"><img src='../images/ok.png' /></a>";
                            },
                            "aTargets": [3]
                        },
                        { "sClass": "center", "aTargets": [0, 2, 3] },
                        { "fnRender":
                            function (oObj) {
                                if (oObj.aData["isActive"] == 'True') {
                                    return "<img src='../images/check.png' />"
                                }
                                else {
                                    return "<img src='../images/cross.png' />"
                                }
                            },
                            "aTargets": [2]
                        }
                    ]
                });

                //mark selected row
                $('body').on("click", '#uom tbody tr', function () {
                    $('#uom tbody tr').removeClass("row_selected");
                    $(this).addClass("row_selected");
                });
                $(".dataTables_filter input").focus();
                return false;

            }




            PickUOM = function (UOMID, UOMDescription, method) {
               // alert(method);
                if (method == "Yearly") {
                    $("#txt_uomYearly").val(UOMDescription);
                    $("#txt_uomidYearly").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxYearly").attr("disabled", false);
                    $("#btn_BrowseUOMMinYearly").attr("disabled", false);
                    $("#txt_uommaxYearly").val('');
                    $("#txt_uommaxidYearly").val('');
                    $("#txt_uomminYearly").val('');
                    $("#txt_uomminidYearly").val('');
                }

                if (method == "Semester1") {
                    $("#txt_uomSemester1").val(UOMDescription);
                    $("#txt_uomidSemester1").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxSemester1").attr("disabled", false);
                    $("#btn_BrowseUOMMinSemester1").attr("disabled", false);
                    $("#txt_uommaxSemester1").val('');
                    $("#txt_uommaxidSemester1").val('');
                    $("#txt_uomminSemester1").val('');
                    $("#txt_uomminidSemester1").val('');
                }

                if (method == "Semester2") {
                    $("#txt_uomSemester2").val(UOMDescription);
                    $("#txt_uomidSemester2").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxSemester2").attr("disabled", false);
                    $("#btn_BrowseUOMMinSemester2").attr("disabled", false);
                    $("#txt_uommaxSemester2").val('');
                    $("#txt_uommaxidSemester2").val('');
                    $("#txt_uomminSemester2").val('');
                    $("#txt_uomminidSemester2").val('');
                }

                if (method == "Q1") {
                    $("#txt_uomQ1").val(UOMDescription);
                    $("#txt_uomidQ1").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxQ1").attr("disabled", false);
                    $("#btn_BrowseUOMMinQ1").attr("disabled", false);
                    $("#txt_uommaxQ1").val('');
                    $("#txt_uommaxidQ1").val('');
                    $("#txt_uomminQ1").val('');
                    $("#txt_uomminidQ1").val('');
                }

                if (method == "Q2") {
                    $("#txt_uomQ2").val(UOMDescription);
                    $("#txt_uomidQ2").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxQ2").attr("disabled", false);
                    $("#btn_BrowseUOMMinQ2").attr("disabled", false);
                    $("#txt_uommaxQ2").val('');
                    $("#txt_uommaxidQ2").val('');
                    $("#txt_uomminQ2").val('');
                    $("#txt_uomminidQ2").val('');
                }

                if (method == "Q3") {
                    $("#txt_uomQ3").val(UOMDescription);
                    $("#txt_uomidQ3").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxQ3").attr("disabled", false);
                    $("#btn_BrowseUOMMinQ3").attr("disabled", false);
                    $("#txt_uommaxQ3").val('');
                    $("#txt_uommaxidQ3").val('');
                    $("#txt_uomminQ3").val('');
                    $("#txt_uomminidQ3").val('');
                }

                if (method == "Q4") {
                    $("#txt_uomQ4").val(UOMDescription);
                    $("#txt_uomidQ4").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxQ4").attr("disabled", false);
                    $("#btn_BrowseUOMMinQ4").attr("disabled", false);
                    $("#txt_uommaxQ4").val('');
                    $("#txt_uommaxidQ4").val('');
                    $("#txt_uomminQ4").val('');
                    $("#txt_uomminidQ4").val('');
                }

                if (method == "Triwulan1") {
                    $("#txt_uomTriwulan1").val(UOMDescription);
                    $("#txt_uomidTriwulan1").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxTriwulan1").attr("disabled", false);
                    $("#btn_BrowseUOMMinTriwulan1").attr("disabled", false);
                    $("#txt_uommaxTriwulan1").val('');
                    $("#txt_uommaxidTriwulan1").val('');
                    $("#txt_uomminTriwulan1").val('');
                    $("#txt_uomminidTriwulan1").val('');
                }

                if (method == "Triwulan2") {
                    $("#txt_uomTriwulan2").val(UOMDescription);
                    $("#txt_uomidTriwulan2").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxTriwulan2").attr("disabled", false);
                    $("#btn_BrowseUOMMinTriwulan2").attr("disabled", false);
                    $("#txt_uommaxTriwulan2").val('');
                    $("#txt_uommaxidTriwulan2").val('');
                    $("#txt_uomminTriwulan2").val('');
                    $("#txt_uomminidTriwulan2").val('');
                }

                if (method == "Triwulan3") {
                    $("#txt_uomTriwulan3").val(UOMDescription);
                    $("#txt_uomidTriwulan3").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxTriwulan3").attr("disabled", false);
                    $("#btn_BrowseUOMMinTriwulan3").attr("disabled", false);
                    $("#txt_uommaxTriwulan3").val('');
                    $("#txt_uommaxidTriwulan3").val('');
                    $("#txt_uomminTriwulan3").val('');
                    $("#txt_uomminidTriwulan3").val('');
                }

                if (method == "Weekly") {
                    $("#txt_uomWeekly").val(UOMDescription);
                    $("#txt_uomidWeekly").val(UOMID);
                    $("#divBrowseUOM").dialog("close");
                    $("#btn_BrowseUOMMaxWeekly").attr("disabled", false);
                    $("#btn_BrowseUOMMinWeekly").attr("disabled", false);
                    $("#txt_uommaxWeekly").val('');
                    $("#txt_uommaxidWeekly").val('');
                    $("#txt_uomminWeekly").val('');
                    $("#txt_uomminidWeekly").val('');
                }
            }

            BrowseUomMax = function (method) {
                $("#divBrowseUOMMax").dialog("option", "title", '<span class="header-text">Select UoM Max</span>');
                $("#divBrowseUOMMax").dialog("open");
                $('#uommax').dataTable({
                    "oLanguage": {
                        "sZeroRecords": "No records to display",
                        "sSearch": "Search"
                    },
                    "bSort": false,
                    "bPaginate": true,
                    "bAutoWidth": true,
                    "bProcessing": true,
                    "bServerSide": true,
                    "bDestroy": true,
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers",
                    "bDeferRender": true,
                    "fnServerData": function (sSource, aoData, fnCallback) {
                        $.ajax({
                            "dataType": 'json',
                            "type": "GET",
                            "url": "../Serializer/UoMDetailByUoMIDSerializer.ashx?UoM=" + $("#txt_uomid" + method).val(),
                            "data": aoData,
                            "success": fnCallback
                        });
                    },
                    "aoColumns": [
                        { "mData": "No" },
                        { "mData": "Description" },
                        { "mData": "ListValue" },
                        { "mData": "isActive" },
                        { "mData": "ID" }
                    ],
                    "aoColumnDefs":
                    [
                        { "fnRender":
                            function (oObj) {
                                return "<a href=\"#\" onclick=\"PickUOMMax('" + oObj.aData["ID"] + "','" + oObj.aData["Description"] + "','" + method + "')\"><img src='../images/ok.png' /></a>";
                            },
                            "aTargets": [4]
                        },
                        { "sClass": "center", "aTargets": [0, 3, 4] },
                        { "fnRender":
                            function (oObj) {
                                if (oObj.aData["isActive"] == 'True') {
                                    return "<img src='../images/check.png' />"
                                }
                                else {
                                    return "<img src='../images/cross.png' />"
                                }
                            },
                            "aTargets": [3]
                        }
                    ]
                });

                //mark selected row
                $('body').on("click", '#uommax tbody tr', function () {
                    $('#uommax tbody tr').removeClass("row_selected");
                    $(this).addClass("row_selected");
                });
                $(".dataTables_filter input").focus();
                return false;

            }



            PickUOMMax = function (UOMID, UOMDescription, method) {
                if (method == "Yearly") {
                    $("#txt_uommaxYearly").val(UOMDescription);
                    $("#txt_uommaxidYearly").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Semester1") {
                    $("#txt_uommaxSemester1").val(UOMDescription);
                    $("#txt_uommaxidSemester1").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Semester2") {
                    $("#txt_uommaxSemester2").val(UOMDescription);
                    $("#txt_uommaxidSemester2").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }


                if (method == "Q1") {
                    $("#txt_uommaxQ1").val(UOMDescription);
                    $("#txt_uommaxidQ1").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Q2") {
                    $("#txt_uommaxQ2").val(UOMDescription);
                    $("#txt_uommaxidQ2").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Q3") {
                    $("#txt_uommaxQ3").val(UOMDescription);
                    $("#txt_uommaxidQ3").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Q4") {
                    $("#txt_uommaxQ4").val(UOMDescription);
                    $("#txt_uommaxidQ4").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Triwulan1") {
                    $("#txt_uommaxTriwulan1").val(UOMDescription);
                    $("#txt_uommaxidTriwulan1").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Triwulan2") {
                    $("#txt_uommaxTriwulan2").val(UOMDescription);
                    $("#txt_uommaxidTriwulan2").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Triwulan3") {
                    $("#txt_uommaxTriwulan3").val(UOMDescription);
                    $("#txt_uommaxidTriwulan3").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }

                if (method == "Weekly") {
                    $("#txt_uommaxWeekly").val(UOMDescription);
                    $("#txt_uommaxidWeekly").val(UOMID);
                    $("#divBrowseUOMMax").dialog("close");
                }
            }

            BrowseUomMin = function (method) {

                $("#divBrowseUOMMin").dialog("option", "title", '<span class="header-text">Select UoM Min</span>');
                $("#divBrowseUOMMin").dialog("open");
                $('#uommin').dataTable({
                    "oLanguage": {
                        "sZeroRecords": "No records to display",
                        "sSearch": "Search"
                    },
                    "bSort": false,
                    "bPaginate": true,
                    "bAutoWidth": true,
                    "bProcessing": true,
                    "bServerSide": true,
                    "bDestroy": true,
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers",
                    "bDeferRender": true,
                    "fnServerData": function (sSource, aoData, fnCallback) {
                        $.ajax({
                            "dataType": 'json',
                            "type": "GET",
                            "url": "../Serializer/UoMDetailByUoMIDSerializer.ashx?UoM=" + $("#txt_uomid" + method).val(),
                            "data": aoData,
                            "success": fnCallback
                        });
                    },
                    "aoColumns": [
                        { "mData": "No" },
                        { "mData": "Description" },
                        { "mData": "ListValue" },
                        { "mData": "isActive" },
                        { "mData": "ID" }
                    ],
                    "aoColumnDefs":
                    [
                        { "fnRender":
                            function (oObj) {
                                return "<a href=\"#\" onclick=\"PickUOMMin('" + oObj.aData["ID"] + "','" + oObj.aData["Description"] + "','" + method + "')\"><img src='../images/ok.png' /></a>";
                            },
                            "aTargets": [4]
                        },
                        { "sClass": "center", "aTargets": [0, 3, 4] },
                        { "fnRender":
                            function (oObj) {
                                if (oObj.aData["isActive"] == 'True') {
                                    return "<img src='../images/check.png' />"
                                }
                                else {
                                    return "<img src='../images/cross.png' />"
                                }
                            },
                            "aTargets": [3]
                        }
                    ]
                });

                //mark selected row
                $('body').on("click", '#uommin tbody tr', function () {
                    $('#uommin tbody tr').removeClass("row_selected");
                    $(this).addClass("row_selected");
                });
                $(".dataTables_filter input").focus();
                return false;

            }



            PickUOMMin = function (UOMID, UOMDescription, method) {
                if (method == "Yearly") {
                    $("#txt_uomminYearly").val(UOMDescription);
                    $("#txt_uomminidYearly").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Semester1") {
                    $("#txt_uomminSemester1").val(UOMDescription);
                    $("#txt_uomminidSemester1").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Semester2") {
                    $("#txt_uomminSemester2").val(UOMDescription);
                    $("#txt_uomminidSemester2").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Q1") {
                    $("#txt_uomminQ1").val(UOMDescription);
                    $("#txt_uomminidQ1").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Q2") {
                    $("#txt_uomminQ2").val(UOMDescription);
                    $("#txt_uomminidQ2").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Q3") {
                    $("#txt_uomminQ3").val(UOMDescription);
                    $("#txt_uomminidQ3").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Q4") {
                    $("#txt_uomminQ4").val(UOMDescription);
                    $("#txt_uomminidQ4").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Triwulan1") {
                    $("#txt_uomminTriwulan1").val(UOMDescription);
                    $("#txt_uomminidTriwulan1").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Triwulan2") {
                    $("#txt_uomminTriwulan2").val(UOMDescription);
                    $("#txt_uomminidTriwulan2").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Triwulan3") {
                    $("#txt_uomminTriwulan3").val(UOMDescription);
                    $("#txt_uomminidTriwulan3").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }

                if (method == "Weekly") {
                    $("#txt_uomminWeekly").val(UOMDescription);
                    $("#txt_uomminidWeekly").val(UOMID);
                    $("#divBrowseUOMMin").dialog("close");
                }
            }

            //===yearly
            $("#btn_BrowseUOMMinYearly").click(function () {
                BrowseUomMin("Yearly");
            });

            $("#btn_BrowseUOMMaxYearly").click(function () {
                BrowseUomMax("Yearly");
            });

            $("#btn_BrowseUOMYearly").click(function () {
                BrowseUom("Yearly");
            });

            //====


            //====semester

            $("#btn_BrowseUOMMinSemester1").click(function () {
                BrowseUomMin("Semester1");
            });

            $("#btn_BrowseUOMMaxSemester1").click(function () {
                BrowseUomMax("Semester1");
            });

            $("#btn_BrowseUOMSemester1").click(function () {
                BrowseUom("Semester1");
            });

            $("#btn_BrowseUOMMinSemester2").click(function () {
                BrowseUomMin("Semester2");
            });

            $("#btn_BrowseUOMMaxSemester2").click(function () {
                BrowseUomMax("Semester2");
            });

            $("#btn_BrowseUOMSemester2").click(function () {
                BrowseUom("Semester2");
            });

            //====

            //===Quarter

            $("#btn_BrowseUOMMinQ1").click(function () {
                BrowseUomMin("Q1");
            });

            $("#btn_BrowseUOMMaxQ1").click(function () {
                BrowseUomMax("Q1");
            });

            $("#btn_BrowseUOMQ1").click(function () {
                BrowseUom("Q1");
            });



            $("#btn_BrowseUOMMinQ2").click(function () {
                BrowseUomMin("Q2");
            });

            $("#btn_BrowseUOMMaxQ2").click(function () {
                BrowseUomMax("Q2");
            });

            $("#btn_BrowseUOMQ2").click(function () {
                BrowseUom("Q2");
            });


            $("#btn_BrowseUOMMinQ3").click(function () {
                BrowseUomMin("Q3");
            });

            $("#btn_BrowseUOMMaxQ3").click(function () {
                BrowseUomMax("Q3");
            });

            $("#btn_BrowseUOMQ3").click(function () {
                BrowseUom("Q3");
            });


            $("#btn_BrowseUOMMinQ4").click(function () {
                BrowseUomMin("Q4");
            });

            $("#btn_BrowseUOMMaxQ4").click(function () {
                BrowseUomMax("Q4");
            });

            $("#btn_BrowseUOMQ4").click(function () {
                BrowseUom("Q4");
            });

            //=====

            //==Triwulan
            $("#btn_BrowseUOMMinTriwulan1").click(function () {
                BrowseUomMin("Triwulan1");
            });

            $("#btn_BrowseUOMMaxTriwulan1").click(function () {
                BrowseUomMax("Triwulan1");
            });

            $("#btn_BrowseUOMTriwulan1").click(function () {
                BrowseUom("Triwulan1");
            });



            $("#btn_BrowseUOMMinTriwulan2").click(function () {
                BrowseUomMin("Triwulan2");
            });

            $("#btn_BrowseUOMMaxTriwulan2").click(function () {
                BrowseUomMax("Triwulan2");
            });

            $("#btn_BrowseUOMTriwulan2").click(function () {
                BrowseUom("Triwulan2");
            });


            $("#btn_BrowseUOMMinTriwulan3").click(function () {
                BrowseUomMin("Triwulan3");
            });

            $("#btn_BrowseUOMMaxTriwulan3").click(function () {
                BrowseUomMax("Triwulan3");
            });

            $("#btn_BrowseUOMTriwulan3").click(function () {
                BrowseUom("Triwulan3");
            });

            //===

            //===weekly
            $("#btn_BrowseUOMMinWeekly").click(function () {
                BrowseUomMin("Weekly");
            });

            $("#btn_BrowseUOMMaxWeekly").click(function () {
                BrowseUomMax("Weekly");
            });

            $("#btn_BrowseUOMWeekly").click(function () {
                BrowseUom("Weekly");
            });

            //====



        });

    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#divCheck").hide();
            $("#divMethod").hide();

            $("#divBrowseUOM").hide();
            $("#divBrowseUOM").dialog({ autoOpen: false, width: 900, height: 500, modal: true, resizable: false });
            $("#divBrowseUOMMax").hide();
            $("#divBrowseUOMMax").dialog({ autoOpen: false, width: 900, height: 500, modal: true, resizable: false });
            $("#divBrowseUOMMin").hide();
            $("#divBrowseUOMMin").dialog({ autoOpen: false, width: 900, height: 500, modal: true, resizable: false });


            var status = $("#hfStatusData").val();
            if (status == "1") {

                var handlerUrl = '<%= ResolveUrl("~/ProcessRequest/MethodDetailHandler.ashx") %>';
                var KpiId = $("#hfKpiId").val();
                var counterID = 0;
                var html = "";
                $("#divCheck").show();
                $("#divMethod").show();
                $("#tableMethod tr").remove();
                $("#tblUomYearly").hide();
                $("#tblUomSemester").hide();
                $("#tblUomQuarter").hide();
                $("#tblUomTriwulan").hide();
                $("#tblUomWeekly").hide();
                $.ajax({
                    type: 'POST',
                    url: handlerUrl + "?method=GetByKPIMethod&KpiId=" + KpiId,
                    contentType: 'application/json',
                    dataType: 'json',
                    success: function (datas) {
                        $.each(datas, function (i, data) {

                            if (data.MethodID == 1) {
                                if (data.MethodDetail.MethodDtlName == "Jan") {
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td colspan='2'>Yearly&nbsp;<input checked='checked' type='checkbox' id='yearly' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td colspan='2'>Yearly&nbsp;<input  type='checkbox' id='yearly' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);

                                    $("#tblUomYearly").show();
                                }

                                if (data.Status == true) {
                                    html = "<tr><td><input type='checkbox' checked='checked' id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='" + data.MaxDay + "' /></td></tr>";
                                }
                                else {
                                    html = "<tr><td> <input type='checkbox'  id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                }

                                $("#tableMethod").append(html);
                            }


                            if (data.MethodID == 2) {
                                if (data.MethodDetail.MethodDtlName == "Jan") {
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td colspan='2'>Semester 1&nbsp;<input checked='checked' type='checkbox' id='semester1' /> Only One Selection</td></tr>";

                                    }
                                    else {
                                        html = "<tr><td colspan='2'>Semester 1&nbsp;<input  type='checkbox' id='semester1' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);

                                    //html = "<tr><td>Semester 2</td><td><input type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    //$("#tableMethod").append(html);
                                }

                                if (data.MethodDetail.MethodDtlName == "Jul") {
                                    //alert(data.isOneSelection);
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>Semester 2&nbsp;<input checked='checked' type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>Semester 2&nbsp;<input  type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                }

                                if (data.Status == true) {
                                    html = "<tr><td> <input type='checkbox' checked='checked' id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='" + data.MaxDay + "' /></td></tr>";
                                }
                                else {
                                    html = "<tr><td> <input type='checkbox'  id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                }

                                $("#tableMethod").append(html);

                                $("#tblUomSemester").show();
                            }

                            if (data.MethodID == 3) {
                                if (data.MethodDetail.MethodDtlName == "Jan") {
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td colspan='2'>Q 1&nbsp;<input checked='checked' type='checkbox' id='Q1' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td colspan='2'>Q 1&nbsp;<input  type='checkbox' id='Q1' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);

                                    //html = "<tr><td>Semester 2</td><td><input type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    //$("#tableMethod").append(html);
                                }

                                if (data.MethodDetail.MethodDtlName == "Apr") {
                                    //alert(data.isOneSelection);
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td style='padding-top:15px;'style='padding-top:15px;' colspan='2'>Q 2&nbsp;<input checked='checked' type='checkbox' id='Q2' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td style='padding-top:15px;'>Q 2&nbsp;<input  type='checkbox' id='Q2' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                    //html = "<tr><td>Semester 2</td><td><input type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    //$("#tableMethod").append(html);
                                }

                                if (data.MethodDetail.MethodDtlName == "Jul") {
                                    //alert(data.isOneSelection);
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>Q 3&nbsp;<input checked='checked' type='checkbox' id='Q3' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>Q 3&nbsp;<input  type='checkbox' id='Q3' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                    //html = "<tr><td>Semester 2</td><td><input type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    //$("#tableMethod").append(html);
                                }

                                if (data.MethodDetail.MethodDtlName == "Oct") {
                                    //alert(data.isOneSelection);
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>Q 4&nbsp;<input checked='checked' type='checkbox' id='Q4' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>Q 4&nbsp;<input  type='checkbox' id='Q4' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                }


                                if (data.Status == true) {
                                    html = "<tr><td> <input type='checkbox' checked='checked' id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='" + data.MaxDay + "' /></td></tr>";
                                }
                                else {
                                    html = "<tr><td> <input type='checkbox'  id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                }

                                $("#tableMethod").append(html);

                                $("#tblUomQuarter").show();
                            }

                            if (data.MethodID == 4) {
                                if (data.MethodDetail.MethodDtlName == "Jan") {
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>1&nbsp;<input checked='checked' type='checkbox' id='triwulan1' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>1&nbsp;<input  type='checkbox' id='triwulan1' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                    //html = "<tr><td>Semester 2</td><td><input type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    //$("#tableMethod").append(html);
                                }

                                if (data.MethodDetail.MethodDtlName == "May") {
                                    //alert(data.isOneSelection);
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>2&nbsp;<input checked='checked' type='checkbox' id='triwulan2' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>2&nbsp;<input  type='checkbox' id='triwulan2' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                    //html = "<tr><td>Semester 2</td><td><input type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    //$("#tableMethod").append(html);
                                }

                                if (data.MethodDetail.MethodDtlName == "Sep") {
                                    //alert(data.isOneSelection);
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>3&nbsp;<input checked='checked' type='checkbox' id='triwulan3' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td style='padding-top:15px;' colspan='2'>3&nbsp;<input  type='checkbox' id='triwulan3' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                }




                                if (data.Status == true) {
                                    html = "<tr><td> <input type='checkbox' checked='checked' id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='" + data.MaxDay + "' /></td></tr>";
                                }
                                else {
                                    html = "<tr><td> <input type='checkbox'  id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                }

                                $("#tableMethod").append(html);
                                $("#tblUomTriwulan").show();
                            }

                            if (data.MethodID == 5) {
                                if (data.MethodDetail.MethodDtlName == "Week 1") {
                                    if (data.isOneSelection == true) {
                                        html = "<tr><td colspan='2'>Weekly&nbsp;<input checked='checked' type='checkbox' id='weekly' /> Only One Selection</td></tr>";
                                    }
                                    else {
                                        html = "<tr><td colspan='2'>Wekkly&nbsp;<input  type='checkbox' id='weekly' /> Only One Selection</td></tr>";
                                    }
                                    $("#tableMethod").append(html);
                                }

                                if (data.Status == true) {
                                    html = "<tr><td> <input type='checkbox' checked='checked' id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='" + data.MaxDay + "' /></td></tr>";
                                }
                                else {
                                    html = "<tr><td> <input type='checkbox'  id='" + data.MethodDtlId + "' name='" + data.MethodDtlId + "' />&nbsp;" + data.MethodDetail.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                }

                                $("#tableMethod").append(html);
                                $("#tblUomWeekly").show();
                            }



                        });

                    },
                    error: function () {
                        alert('Error load method detail !');
                    }
                });


            }
            $('#ddlMethod').change(function () {

                var handlerUrl = '<%= ResolveUrl("~/ProcessRequest/MethodDetailHandler.ashx") %>';
                var MethodID = $("#ddlMethod option:selected").val();
                var counterID = 0;
                var html = "";
                $("#divCheck").show();
                $("#divMethod").show();
                $("#tblUomYearly").hide();
                $("#tblUomSemester").hide();
                $("#tblUomQuarter").hide();
                $("#tblUomTriwulan").hide();
                $("#tblUomWeekly").hide();
                $("#tableMethod tr").remove();
                //html = "<tr><td colspan='2'><input type='checkbox' id='selectAll' />Select/UnSelect All</td></tr>";
                //$("#tableMethod").append(html);
                $.ajax({
                    type: 'POST',
                    url: handlerUrl + "?method=GetByMethodID&MethodID=" + MethodID,
                    contentType: 'application/json',
                    dataType: 'json',
                    success: function (datas) {
                        $.each(datas, function (i, data) {

                            if (MethodID == 1) {

                                if (data.MethodDtlName == "Jan") {
                                    html = "<tr><td colspan='2'>Yearly&nbsp;<input type='checkbox' id='yearly' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                }

                                html = "<tr><td> <input type='checkbox' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' />&nbsp;" + data.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                $("#tableMethod").append(html);

                                $("#tblUomYearly").show();
                            }


                            if (MethodID == 2) {

                                if (data.MethodDtlName == "Jan") {
                                    html = "<tr><td colspan='2'>Semester 1 &nbsp;<input type='checkbox' id='semester1' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);

                                }


                                if (data.MethodDtlName == "Jul") {
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);
                                    html = "<tr><td style='padding-top:15px;' colspan='2'>Semester 2&nbsp;<input type='checkbox' id='semester2' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);

                                }


                                html = "<tr><td> <input type='checkbox' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' />&nbsp;" + data.MethodDtlName + "</td><td style='padding-left:40px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                $("#tableMethod").append(html);

                                $("#tblUomSemester").show();

                            }

                            if (MethodID == 3) {

                                if (data.MethodDtlName == "Jan") {
                                    html = "<tr><td colspan='2'>Q 1 &nbsp;<input type='checkbox' id='Q1' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);
                                }

                                if (data.MethodDtlName == "Apr") {
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);

                                    html = "<tr><td style='padding-top:15px;' colspan='2'>Q 2&nbsp;<input type='checkbox' id='Q2' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);

                                }

                                if (data.MethodDtlName == "Jul") {
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);

                                    html = "<tr><td style='padding-top:15px;' colspan='2'>Q 3&nbsp;<input type='checkbox' id='Q3' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);

                                }

                                if (data.MethodDtlName == "Oct") {
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);

                                    html = "<tr><td style='padding-top:15px;'>Q 4&nbsp;<input type='checkbox' id='Q4' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                }

                                html = "<tr><td> <input type='checkbox' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' />&nbsp;" + data.MethodDtlName + "</td><td style='padding-left:1px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                $("#tableMethod").append(html);

                                $("#tblUomQuarter").show();

                            }


                            if (MethodID == 4) {

                                if (data.MethodDtlName == "Jan") {
                                    html = "<tr><td colspan='2'>1&nbsp;<input type='checkbox' id='triwulan1' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                }

                                if (data.MethodDtlName == "May") {
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);

                                    html = "<tr><td style='padding-top:15px;' colspan='2'>2&nbsp;<input type='checkbox' id='triwulan2' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                }

                                if (data.MethodDtlName == "Sep") {
                                    //html = "<tr><td colspan='2'><br /></td></tr>";
                                    //$("#tableMethod").append(html);

                                    html = "<tr><td style='padding-top:15px;'>3&nbsp;<input type='checkbox' id='triwulan3' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                }



                                html = "<tr><td> <input type='checkbox' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' />&nbsp;" + data.MethodDtlName + "</td><td style='padding-left:1px;'>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                $("#tableMethod").append(html);
                                $("#tblUomTriwulan").show();

                            }

                            if (MethodID == 5) {

                                if (data.MethodDtlName == "Week 1") {
                                    html = "<tr><td>Weekly&nbsp;<input type='checkbox' id='weekly' /> Only One Selection</td></tr>";
                                    $("#tableMethod").append(html);
                                }

                                html = "<tr><td> <input type='checkbox' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' />&nbsp;" + data.MethodDtlName + "</td><td>Max Day :&nbsp;&nbsp;<input size='5' type='text' id='" + data.MethodDetailID + "' name='" + data.MethodDetailID + "' value='60' /></td></tr>";
                                $("#tableMethod").append(html);
                                $("#tblUomWeekly").show();
                            }


                        });

                    },
                    error: function () {
                        alert('Error load method detail !');
                    }
                });

            });

            $('#selectAll').click(function (e) {
                if ($(this).prop('checked')) {
                    $('#tableMethod tr td input[type="checkbox"]').each(function () {
                        $(this).prop('checked', true);
                    });
                } else {
                    $('#tableMethod tr td input[type="checkbox"]').each(function () {
                        $(this).prop('checked', false);
                    });
                }
            });

            $("#btn_closemethod").click(function () {
                parent.$("#divdetailMethod").dialog("close");
                return false;
            });

            $("#btn_savemethod").click(function () {
                var MethodID = $("#ddlMethod option:selected").val();
                var KpiId = $("#hfKpiId").val();
                if (MethodID == 0) {
                    alert("Pilih Method sebelum simpan data !")
                    return false;
                }

                var MethodCount = $("#ddlMethodCount option:selected").val();

                var param = "?";
                var isOneSelection = '0';
                var MaxDay = "";


                //                $('#form1 td input:checked').each(function () {
                //                    var $cb = $(this);
                //                    if ($cb.attr('id') == 'chkOnlyOne') {
                //                        isOneSelection = '1';
                //                    }

                //                });

                var Status = "";
                var MethodDtlId = "";
                var isOnlyCheck = "";
                var isOnlyCheck2 = "";
                var UomId = "";
                var UomIdMax = "";
                var UomIdMin = "";
                var PercentageMax = "";
                var PercentageMin = "";

                if (MethodID == 1) {
                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox != "yearly") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                Status += "1" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }
                            else {
                                Status += "0" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }

                            var value = row.find('input[type="text"]').val();
                            if (value == "") {
                                value = "60";
                            }
                            MaxDay += value + "|";
                        }

                    });


                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox == "yearly") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                isOnlyCheck = "1|1|1|1|1|1|1|1|1|1|1|1|"; // +"|";
                            }
                            else {
                                isOnlyCheck = "0|0|0|0|0|0|0|0|0|0|0|0|"; // +"|";

                            }
                        }

                        isOnlyCheck2 += isOnlyCheck + "|";

                    });

                    var UomIdYearly = $("#txt_uomidYearly").val();
                    if (UomIdYearly != "") {
                        UomId = UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|";
                    }
                    else {
                        UomId = "0|0|0|0|0|0|0|0|0|0|0|0|"
                    }

                    var UomIdMaxYearly = $("#txt_uommaxidYearly").val();
                    if (UomIdMaxYearly != "") {
                        UomIdMax = UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|";
                    }
                    else {
                        UomIdMax = "0|0|0|0|0|0|0|0|0|0|0|0|"
                    }

                    var UomIdMinYearly = $("#txt_uomminidYearly").val();
                    if (UomIdMinYearly != "") {
                        UomIdMin = UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|";
                    }
                    else {
                        UomIdMin = "0|0|0|0|0|0|0|0|0|0|0|0"
                    }

                    var PercentageMaxYearly = $("#txtPrecentageMaxYearly").val();
                    if (PercentageMaxYearly != "") {
                        PercentageMax = PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|";
                    }
                    else {
                        PercentageMax = "0|0|0|0|0|0|0|0|0|0|0|0"
                    }

                    var PercentageMinYearly = $("#txtPrecentageMinYearly").val();
                    if (PercentageMinYearly != "") {
                        PercentageMin = PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|";
                    }
                    else {
                        PercentageMin = "0|0|0|0|0|0|0|0|0|0|0|0|"
                    }
                }

                if (MethodID == 2) {
                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');

                        if (idCheckBox != "semester1" && idCheckBox != "semester2" && idCheckBox != "undefined" && idCheckBox.toString().trim() != "") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                Status += "1" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }
                            else {
                                Status += "0" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }

                            var value = row.find('input[type="text"]').val();
                            if (value == "") {
                                value = "60";
                            }
                            MaxDay += value + "|";
                        }

                    });

                    //alert(MethodDtlId);
                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox == "semester1") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                //isOnlyCheck = "1"; // +"|";
                                isOnlyCheck = "1|1|1|1|1|1"
                            }
                            else {
                                //isOnlyCheck = "0"; // +"|";
                                isOnlyCheck = "0|0|0|0|0|0"

                            }
                        }

                        if (idCheckBox == "semester2") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                //isOnlyCheck = "1"; // +"|";
                                isOnlyCheck += "|1|1|1|1|1|1|"
                            }
                            else {
                                //isOnlyCheck = "0"; // +"|";
                                isOnlyCheck += "|0|0|0|0|0|0|"
                            }
                        }

                        //isOnlyCheck2 += isOnlyCheck + "|";

                    });

                    //==semester 1
                    var UomIdSemester1 = $("#txt_uomidSemester1").val();
                    if (UomIdSemester1 != "") {
                        UomId = UomIdSemester1 + "|" + UomIdSemester1 + "|" + UomIdSemester1 + "|" + UomIdSemester1 + "|" + UomIdSemester1 + "|" + UomIdSemester1 + "|"; // +UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|";
                    }
                    else {
                        UomId = "0|0|0|0|0|0|";
                    }

                    var UomIdMaxSemester1 = $("#txt_uommaxidSemester1").val();
                    if (UomIdMaxSemester1 != "") {
                        UomIdMax = UomIdMaxSemester1 + "|" + UomIdMaxSemester1 + "|" + UomIdMaxSemester1 + "|" + UomIdMaxSemester1 + "|" + UomIdMaxSemester1 + "|" + UomIdMaxSemester1 + "|"; // +UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|";
                    }
                    else {
                        UomIdMax = "0|0|0|0|0|0|";
                    }

                    var UomIdMinSemester1 = $("#txt_uomminidSemester1").val();
                    if (UomIdMinSemester1 != "") {
                        UomIdMin = UomIdMinSemester1 + "|" + UomIdMinSemester1 + "|" + UomIdMinSemester1 + "|" + UomIdMinSemester1 + "|" + UomIdMinSemester1 + "|" + UomIdMinSemester1 + "|"; // +UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|";
                    }
                    else {
                        UomIdMin = "0|0|0|0|0|0|";
                    }

                    var PercentageMaxSemester1 = $("#txtPrecentageMaxSemester1").val();
                    if (PercentageMaxSemester1 != "") {
                        PercentageMax = PercentageMaxSemester1 + "|" + PercentageMaxSemester1 + "|" + PercentageMaxSemester1 + "|" + PercentageMaxSemester1 + "|" + PercentageMaxSemester1 + "|" + PercentageMaxSemester1 + "|"; // +PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|";
                    }
                    else {
                        PercentageMax = "0|0|0|0|0|0|";
                    }

                    var PercentageMinSemester1 = $("#txtPrecentageMinSemester1").val();
                    if (PercentageMinSemester1 != "") {
                        PercentageMin = PercentageMinSemester1 + "|" + PercentageMinSemester1 + "|" + PercentageMinSemester1 + "|" + PercentageMinSemester1 + "|" + PercentageMinSemester1 + "|" + PercentageMinSemester1 + "|"; // +PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|";
                    }
                    else {
                        PercentageMin = "0|0|0|0|0|0|";
                    }

                    //==

                    //==semester 2
                    var UomIdSemester2 = $("#txt_uomidSemester2").val();
                    if (UomIdSemester2 != "") {
                        UomId += UomIdSemester2 + "|" + UomIdSemester2 + "|" + UomIdSemester2 + "|" + UomIdSemester2 + "|" + UomIdSemester2 + "|" + UomIdSemester2 + "|"; // +UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|" + UomIdYearly + "|";
                    }
                    else {
                        UomId += "0|0|0|0|0|0|";
                    }

                    var UomIdMaxSemester2 = $("#txt_uommaxidSemester2").val();
                    if (UomIdMaxSemester2 != "") {
                        UomIdMax += UomIdMaxSemester2 + "|" + UomIdMaxSemester2 + "|" + UomIdMaxSemester2 + "|" + UomIdMaxSemester2 + "|" + UomIdMaxSemester2 + "|" + UomIdMaxSemester2 + "|"; // +UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|" + UomIdMaxYearly + "|";
                    }
                    else {
                        UomIdMax += "0|0|0|0|0|0|";
                    }

                    var UomIdMinSemester2 = $("#txt_uomminidSemester2").val();
                    if (UomIdMinSemester2 != "") {
                        UomIdMin += UomIdMinSemester2 + "|" + UomIdMinSemester2 + "|" + UomIdMinSemester2 + "|" + UomIdMinSemester2 + "|" + UomIdMinSemester2 + "|" + UomIdMinSemester2 + "|"; // +UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|" + UomIdMinYearly + "|";
                    }
                    else {
                        UomIdMin += "0|0|0|0|0|0|";
                    }

                    var PercentageMaxSemester2 = $("#txtPrecentageMaxSemester2").val();
                    if (PercentageMaxSemester2 != "") {
                        PercentageMax += PercentageMaxSemester2 + "|" + PercentageMaxSemester2 + "|" + PercentageMaxSemester2 + "|" + PercentageMaxSemester2 + "|" + PercentageMaxSemester2 + "|" + PercentageMaxSemester2 + "|"; // +PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|" + PercentageMaxYearly + "|";
                    }
                    else {
                        PercentageMax += "0|0|0|0|0|0|";
                    }

                    var PercentageMinSemester2 = $("#txtPrecentageMinSemester2").val();
                    if (PercentageMinSemester2 != "") {
                        PercentageMin += PercentageMinSemester2 + "|" + PercentageMinSemester2 + "|" + PercentageMinSemester2 + "|" + PercentageMinSemester2 + "|" + PercentageMinSemester2 + "|" + PercentageMinSemester2 + "|"; // +PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|" + PercentageMinYearly + "|";
                    }
                    else {
                        PercentageMin += "0|0|0|0|0|0|";
                    }

                    //==
                }

                if (MethodID == 3) {
                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox != "Q1" && idCheckBox != "Q2" && idCheckBox != "Q3" && idCheckBox != "Q4" && idCheckBox != "undefined") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                Status += "1" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }
                            else {
                                Status += "0" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }

                            var value = row.find('input[type="text"]').val();
                            if (value == "") {
                                value = "60";
                            }
                            MaxDay += value + "|";
                        }

                    });

                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox == "Q1") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                //isOnlyCheck = "1"; // +"|";
                                isOnlyCheck = "1|1|1";
                            }
                            else {
                                //isOnlyCheck = "0"; // +"|";
                                isOnlyCheck = "0|0|0";

                            }
                        }

                        if (idCheckBox == "Q2") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                //isOnlyCheck = "1"; // +"|";
                                isOnlyCheck += "|1|1|1";
                            }
                            else {
                                //isOnlyCheck = "0"; // +"|";
                                isOnlyCheck += "|0|0|0";

                            }
                        }

                        if (idCheckBox == "Q3") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                //isOnlyCheck = "1"; // +"|";
                                isOnlyCheck += "|1|1|1";
                            }
                            else {
                                //isOnlyCheck = "0"; // +"|";
                                isOnlyCheck += "|0|0|0";

                            }
                        }

                        if (idCheckBox == "Q4") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                //isOnlyCheck = "1"; // +"|";
                                isOnlyCheck += "|1|1|1|";
                            }
                            else {
                                //isOnlyCheck = "0"; // +"|";
                                isOnlyCheck += "|0|0|0|";

                            }
                        }

                        isOnlyCheck2 += isOnlyCheck + "|";

                    });

                    //==Q1
                    var UomIdQ1 = $("#txt_uomidQ1").val();
                    if (UomIdQ1 != "") {
                        UomId = UomIdQ1 + "|" + UomIdQ1 + "|" + UomIdQ1 + "|";
                    }
                    else {
                        UomId = "0|0|0|";
                    }

                    var UomIdMaxQ1 = $("#txt_uommaxidQ1").val();
                    if (UomIdMaxQ1 != "") {
                        UomIdMax = UomIdMaxQ1 + "|" + UomIdMaxQ1 + "|" + UomIdMaxQ1 + "|";
                    }
                    else {
                        UomIdMax = "0|0|0|";
                    }

                    var UomIdMinQ1 = $("#txt_uomminidQ1").val();
                    if (UomIdMinQ1 != "") {
                        UomIdMin = UomIdMinQ1 + "|" + UomIdMinQ1 + "|" + UomIdMinQ1 + "|";
                    }
                    else {
                        UomIdMin = "0|0|0|";
                    }

                    var PercentageMaxQ1 = $("#txtPrecentageMaxQ1").val();
                    if (PercentageMaxQ1 != "") {
                        PercentageMax = PercentageMaxQ1 + "|" + PercentageMaxQ1 + "|" + PercentageMaxQ1 + "|";
                    }
                    else {
                        PercentageMax = "0|0|0|";
                    }

                    var PercentageMinQ1 = $("#txtPrecentageMinQ1").val();
                    if (PercentageMinQ1 != "") {
                        PercentageMin = PercentageMinQ1 + "|" + PercentageMinQ1 + "|" + PercentageMinQ1 + "|";
                    }
                    else {
                        PercentageMin = "0|0|0|";
                    }

                    //==



                    //==Q2
                    var UomIdQ2 = $("#txt_uomidQ2").val();
                    if (UomIdQ2 != "") {
                        UomId += UomIdQ2 + "|" + UomIdQ2 + "|" + UomIdQ2 + "|";
                    }
                    else {
                        UomId += "0|0|0|";
                    }

                    var UomIdMaxQ2 = $("#txt_uommaxidQ2").val();
                    if (UomIdMaxQ2 != "") {
                        UomIdMax += UomIdMaxQ2 + "|" + UomIdMaxQ2 + "|" + UomIdMaxQ2 + "|";
                    }
                    else {
                        UomIdMax += "0|0|0|";
                    }

                    var UomIdMinQ2 = $("#txt_uomminidQ2").val();
                    if (UomIdMinQ2 != "") {
                        UomIdMin += UomIdMinQ2 + "|" + UomIdMinQ2 + "|" + UomIdMinQ2 + "|";
                    }
                    else {
                        UomIdMin += "0|0|0|";
                    }

                    var PercentageMaxQ2 = $("#txtPrecentageMaxQ2").val();
                    if (PercentageMaxQ2 != "") {
                        PercentageMax += PercentageMaxQ2 + "|" + PercentageMaxQ2 + "|" + PercentageMaxQ2 + "|";
                    }
                    else {
                        PercentageMax += "0|0|0|";
                    }

                    var PercentageMinQ2 = $("#txtPrecentageMinQ2").val();
                    if (PercentageMinQ2 != "") {
                        PercentageMin += PercentageMinQ2 + "|" + PercentageMinQ2 + "|" + PercentageMinQ2 + "|";
                    }
                    else {
                        PercentageMin += "0|0|0|";
                    }

                    //==

                    //==Q3
                    var UomIdQ3 = $("#txt_uomidQ3").val();
                    if (UomIdQ3 != "") {
                        UomId += UomIdQ3 + "|" + UomIdQ3 + "|" + UomIdQ3 + "|";
                    }
                    else {
                        UomId += "0|0|0|";
                    }

                    var UomIdMaxQ3 = $("#txt_uommaxidQ3").val();
                    if (UomIdMaxQ3 != "") {
                        UomIdMax += UomIdMaxQ3 + "|" + UomIdMaxQ3 + "|" + UomIdMaxQ3 + "|";
                    }
                    else {
                        UomIdMax += "0|0|0|";
                    }

                    var UomIdMinQ3 = $("#txt_uomminidQ3").val();
                    if (UomIdMinQ3 != "") {
                        UomIdMin += UomIdMinQ3 + "|" + UomIdMinQ3 + "|" + UomIdMinQ3 + "|";
                    }
                    else {
                        UomIdMin += "0|0|0|";
                    }

                    var PercentageMaxQ3 = $("#txtPrecentageMaxQ3").val();
                    if (PercentageMaxQ3 != "") {
                        PercentageMax += PercentageMaxQ3 + "|" + PercentageMaxQ3 + "|" + PercentageMaxQ3 + "|";
                    }
                    else {
                        PercentageMax += "0|0|0|";
                    }

                    var PercentageMinQ3 = $("#txtPrecentageMinQ3").val();
                    if (PercentageMinQ3 != "") {
                        PercentageMin += PercentageMinQ3 + "|" + PercentageMinQ3 + "|" + PercentageMinQ3 + "|";
                    }
                    else {
                        PercentageMin += "0|0|0|";
                    }

                    //==

                    //==Q4
                    var UomIdQ4 = $("#txt_uomidQ4").val();
                    if (UomIdQ4 != "") {
                        UomId += UomIdQ4 + "|" + UomIdQ4 + "|" + UomIdQ4 + "|";
                    }
                    else {
                        UomId += "0|0|0|";
                    }

                    var UomIdMaxQ4 = $("#txt_uommaxidQ4").val();
                    if (UomIdMaxQ4 != "") {
                        UomIdMax += UomIdMaxQ4 + "|" + UomIdMaxQ4 + "|" + UomIdMaxQ4 + "|";
                    }
                    else {
                        UomIdMax += "0|0|0|";
                    }

                    var UomIdMinQ4 = $("#txt_uomminidQ4").val();
                    if (UomIdMinQ4 != "") {
                        UomIdMin += UomIdMinQ4 + "|" + UomIdMinQ4 + "|" + UomIdMinQ4 + "|";
                    }
                    else {
                        UomIdMin += "0|0|0|";
                    }

                    var PercentageMaxQ4 = $("#txtPrecentageMaxQ4").val();
                    if (PercentageMaxQ4 != "") {
                        PercentageMax += PercentageMaxQ4 + "|" + PercentageMaxQ4 + "|" + PercentageMaxQ4 + "|";
                    }
                    else {
                        PercentageMax += "0|0|0|";
                    }

                    var PercentageMinQ4 = $("#txtPrecentageMinQ4").val();
                    if (PercentageMinQ4 != "") {
                        PercentageMin += PercentageMinQ4 + "|" + PercentageMinQ4 + "|" + PercentageMinQ4 + "|";
                    }
                    else {
                        PercentageMin += "0|0|0|";
                    }

                    //==



                }

                if (MethodID == 4) {
                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox != "triwulan1" && idCheckBox != "triwulan2" && idCheckBox != "triwulan3" && idCheckBox != "undefined") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                Status += "1" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }
                            else {
                                Status += "0" + "|";
                                MethodDtlId += idCheckBox + "|";
                            }

                            var value = row.find('input[type="text"]').val();
                            if (value == "") {
                                value = "60";
                            }
                            MaxDay += value + "|";
                        }

                    });


                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox == "triwulan1") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                isOnlyCheck = "1|1|1|1"; // +"|";
                            }
                            else {
                                isOnlyCheck = "0|0|0|0"; // +"|";

                            }
                        }

                        if (idCheckBox == "triwulan2") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                isOnlyCheck += "|1|1|1|1";
                            }
                            else {
                                isOnlyCheck += "|0|0|0|0";

                            }
                        }

                        if (idCheckBox == "triwulan3") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                isOnlyCheck += "|1|1|1|1|";
                            }
                            else {
                                isOnlyCheck += "|0|0|0|0|";

                            }
                        }



                        isOnlyCheck2 += isOnlyCheck + "|";

                    });

                    //==Triwulan1
                    var UomIdTriwulan1 = $("#txt_uomidTriwulan1").val();
                    if (UomIdTriwulan1 != "") {
                        UomId = UomIdTriwulan1 + "|" + UomIdTriwulan1 + "|" + UomIdTriwulan1 + "|" + UomIdTriwulan1 + "|";
                    }
                    else {
                        UomId = "0|0|0|0|";
                    }

                    var UomIdMaxTriwulan1 = $("#txt_uommaxidTriwulan1").val();
                    if (UomIdMaxTriwulan1 != "") {
                        UomIdMax = UomIdMaxTriwulan1 + "|" + UomIdMaxTriwulan1 + "|" + UomIdMaxTriwulan1 + "|" + UomIdMaxTriwulan1 + "|";
                    }
                    else {
                        UomIdMax = "0|0|0|0|";
                    }

                    var UomIdMinTriwulan1 = $("#txt_uomminidTriwulan1").val();
                    if (UomIdMinTriwulan1 != "") {
                        UomIdMin = UomIdMinTriwulan1 + "|" + UomIdMinTriwulan1 + "|" + UomIdMinTriwulan1 + "|" + UomIdMinTriwulan1 + "|";
                    }
                    else {
                        UomIdMin = "0|0|0|0|";
                    }

                    var PercentageMaxTriwulan1 = $("#txtPrecentageMaxTriwulan1").val();
                    if (PercentageMaxTriwulan1 != "") {
                        PercentageMax = PercentageMaxTriwulan1 + "|" + PercentageMaxTriwulan1 + "|" + PercentageMaxTriwulan1 + "|" + PercentageMaxTriwulan1 + "|";
                    }
                    else {
                        PercentageMax = "0|0|0|0|";
                    }

                    var PercentageMinTriwulan1 = $("#txtPrecentageMinTriwulan1").val();
                    if (PercentageMinTriwulan1 != "") {
                        PercentageMin = PercentageMinTriwulan1 + "|" + PercentageMinTriwulan1 + "|" + PercentageMinTriwulan1 + "|" + PercentageMinTriwulan1 + "|";
                    }
                    else {
                        PercentageMin = "0|0|0|0|";
                    }

                    //==



                    //==Triwulan2
                    var UomIdTriwulan2 = $("#txt_uomidTriwulan2").val();
                    if (UomIdTriwulan2 != "") {
                        UomId += UomIdTriwulan2 + "|" + UomIdTriwulan2 + "|" + UomIdTriwulan2 + "|" + UomIdTriwulan2 + "|";
                    }
                    else {
                        UomId += "0|0|0|0|";
                    }

                    var UomIdMaxTriwulan2 = $("#txt_uommaxidTriwulan2").val();
                    if (UomIdMaxTriwulan2 != "") {
                        UomIdMax += UomIdMaxTriwulan2 + "|" + UomIdMaxTriwulan2 + "|" + UomIdMaxTriwulan2 + "|" + UomIdMaxTriwulan2 + "|";
                    }
                    else {
                        UomIdMax += "0|0|0|0|";
                    }

                    var UomIdMinTriwulan2 = $("#txt_uomminidTriwulan2").val();
                    if (UomIdMinTriwulan2 != "") {
                        UomIdMin += UomIdMinTriwulan2 + "|" + UomIdMinTriwulan2 + "|" + UomIdMinTriwulan2 + "|" + UomIdMinTriwulan2 + "|";
                    }
                    else {
                        UomIdMin += "0|0|0|0|";
                    }

                    var PercentageMaxTriwulan2 = $("#txtPrecentageMaxTriwulan2").val();
                    if (PercentageMaxTriwulan2 != "") {
                        PercentageMax += PercentageMaxTriwulan2 + "|" + PercentageMaxTriwulan2 + "|" + PercentageMaxTriwulan2 + "|" + PercentageMaxTriwulan2 + "|";
                    }
                    else {
                        PercentageMax += "0|0|0|0|";
                    }

                    var PercentageMinTriwulan2 = $("#txtPrecentageMinTriwulan2").val();
                    if (PercentageMinTriwulan2 != "") {
                        PercentageMin += PercentageMinTriwulan2 + "|" + PercentageMinTriwulan2 + "|" + PercentageMinTriwulan2 + "|" + PercentageMinTriwulan2 + "|";
                    }
                    else {
                        PercentageMin += "0|0|0|0|";
                    }

                    //==Triwulan3
                    var UomIdTriwulan3 = $("#txt_uomidTriwulan3").val();
                    if (UomIdTriwulan3 != "") {
                        UomId += UomIdTriwulan3 + "|" + UomIdTriwulan3 + "|" + UomIdTriwulan3 + "|" + UomIdTriwulan3 + "|";
                    }
                    else {
                        UomId += "0|0|0|0|";
                    }

                    var UomIdMaxTriwulan3 = $("#txt_uommaxidTriwulan3").val();
                    if (UomIdMaxTriwulan3 != "") {
                        UomIdMax += UomIdMaxTriwulan3 + "|" + UomIdMaxTriwulan3 + "|" + UomIdMaxTriwulan3 + "|" + UomIdMaxTriwulan3 + "|";
                    }
                    else {
                        UomIdMax += "0|0|0|0|";
                    }

                    var UomIdMinTriwulan3 = $("#txt_uomminidTriwulan3").val();
                    if (UomIdMinTriwulan3 != "") {
                        UomIdMin += UomIdMinTriwulan3 + "|" + UomIdMinTriwulan3 + "|" + UomIdMinTriwulan3 + "|" + UomIdMinTriwulan3 + "|";
                    }
                    else {
                        UomIdMin += "0|0|0|0|";
                    }

                    var PercentageMaxTriwulan3 = $("#txtPrecentageMaxTriwulan3").val();
                    if (PercentageMaxTriwulan3 != "") {
                        PercentageMax += PercentageMaxTriwulan3 + "|" + PercentageMaxTriwulan3 + "|" + PercentageMaxTriwulan3 + "|" + PercentageMaxTriwulan3 + "|";
                    }
                    else {
                        PercentageMax += "0|0|0|0|";
                    }

                    var PercentageMinTriwulan3 = $("#txtPrecentageMinTriwulan3").val();
                    if (PercentageMinTriwulan3 != "") {
                        PercentageMin += PercentageMinTriwulan3 + "|" + PercentageMinTriwulan3 + "|" + PercentageMinTriwulan3 + "|" + PercentageMinTriwulan3 + "|";
                    }
                    else {
                        PercentageMin += "0|0|0|0|";
                    }

                    //==
                }

                if (MethodID == 5) {

                    //==weekly
                    var UomIdWeekly = $("#txt_uomidWeekly").val();


                    var UomIdMaxWeekly = $("#txt_uommaxidWeekly").val();
                    

                    var UomIdMinWeekly = $("#txt_uomminidWeekly").val();
                    

                    var PercentageMaxWeekly = $("#txtPrecentageMaxWeekly").val();
                   

                    var PercentageMinWeekly = $("#txtPrecentageMinWeekly").val();
                    

                    //==

                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox == "weekly") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                //isOnlyCheck = "1|1|1|1|1|1|1|1|1|1|1|1|"; // +"|";
                                isOnlyCheck2 = "1";
                            }
                            else {
                                //isOnlyCheck = "0|0|0|0|0|0|0|0|0|0|0|0|"; // +"|";
                                isOnlyCheck2 = "0";

                            }
                        }
                    });

                    $('#tableMethod tr').each(function () {
                        var row = $(this);
                        var idCheckBox = row.find('input[type="checkbox"]').attr('id');
                        if (idCheckBox != "weekly") {
                            if (row.find('input[type="checkbox"]').is(':checked')) {
                                Status += "1" + "|";
                                MethodDtlId += idCheckBox + "|";
                                isOnlyCheck += isOnlyCheck2 + "|";

                                
                            }
                            else {
                                Status += "0" + "|";
                                MethodDtlId += idCheckBox + "|";
                                isOnlyCheck += isOnlyCheck2 + "|";
                            }

                            var value = row.find('input[type="text"]').val();
                            if (value == "") {
                                value = "60";
                            }
                            MaxDay += value + "|";
                        }

                        if (UomIdWeekly != "") {
                            UomId += UomIdWeekly + "|";
                        }
                        else {
                            UomId += "0" + "|";
                        }

                        if (UomIdMaxWeekly != "") {
                            UomIdMax += UomIdMaxWeekly+"|";
                        }
                        else {
                            UomIdMax += "0" + "|";
                        }

                        if (UomIdMinWeekly != "") {
                            UomIdMin += UomIdMinWeekly+"|";
                        }
                        else {
                            UomIdMin += "0" + "|";
                        }

                        if (PercentageMaxWeekly != "") {
                            PercentageMax += PercentageMaxWeekly + "|";
                        }
                        else {
                            PercentageMax += "0" + "|";
                        }

                        if (PercentageMinWeekly != "") {
                            PercentageMin += PercentageMinWeekly + "|";
                        }
                        else {
                            PercentageMin += "0" + "|";
                        }

                    });



                    //isOnlyCheck += "|";
                    //isOnlyCheck2 += isOnlyCheck + "|";


                }
                //alert(UomId);
                //alert(MethodDtlId);
                //alert(isOnlyCheck);
                //alert(UomIdMin);

                param = param + "KpiId=" + KpiId;
                param = param + "&MethodID=" + MethodID;
                param = param + "&Status=" + Status;
                param = param + "&MethodDtlId=" + MethodDtlId;
                param = param + "&isOneSelection=" + isOnlyCheck;
                param = param + "&CurrUser=" + $("#txt_user").val();
                param = param + "&CountMethodBy=" + MethodCount;
                param = param + "&MaxDay=" + MaxDay;
                param = param + "&UoMID=" + UomId;
                param = param + "&UoMDetailIDMax=" + UomIdMax;
                param = param + "&UoMDetailIDMin=" + UomIdMin;
                param = param + "&PercentageMax=" + PercentageMax;
                param = param + "&PercentageMin=" + PercentageMin;
                ProcessRequest("KPIMethodHandler.ashx" + param, "#divdetailMethod", "#KPITable");
                return false;


            });

        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <table border="0">
        <tr>
            <td style="padding-right: 40px;">
                Method
            </td>
            <td style="padding-right: 10px;">
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlMethod" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td style="padding-right: 40px;">
                Count Method By
            </td>
            <td style="padding-right: 10px;">
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlMethodCount" runat="server">
                    <asp:ListItem Text="Summary" Value="Summary"></asp:ListItem>
                    <asp:ListItem Text="Average" Value="Average"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    <br />
    <div id="divMethod" style="overflow: auto; height: 400px;">
        <div style="float: left; border-right: 1px  #ccc; border-right-style: dashed; padding-right: 10px;
            width: 35%; margin-right: 10px;">
            <table id="tableMethod" border="0" cellpadding="0" cellspacing="0">
            </table>
        </div>
        <div style="float: left;">
            <table id="tblUomYearly" class="dialogTable">
                <tr>
                    <td>
                        Unit of Measure
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomYearly" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMYearly" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputYearly" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidYearly" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxYearly" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxYearly" MaxLength="3" Text="100" Width="50px" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxYearly" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputYearly" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidYearly" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminYearly" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinYearly" MaxLength="3" Width="50px" Text="80" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinYearly" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputYearly" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidYearly" runat="server" />
                    </td>
                </tr>
            </table>
            <table id="tblUomSemester" class="dialogTable">
                <tr>
                    <td>
                        Unit of Measure Semester 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomSemester1" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMSemester1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputSemester1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidSemester1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Semester 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxSemester1" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxSemester1" MaxLength="3" Text="100" Width="50px"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxSemester1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputSemester1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidSemester1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Semester 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminSemester1" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinSemester1" MaxLength="3" Width="50px" Text="80"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinSemester1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputSemester1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidSemester1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 25px;">
                        Unit of Measure Semester 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomSemester2" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMSemester2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputSemester2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidSemester2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Semester 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxSemester2" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxSemester2" MaxLength="3" Text="100" Width="50px"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxSemester2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputSemester2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidSemester2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Semester 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminSemester2" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinSemester2" MaxLength="3" Width="50px" Text="80"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinSemester2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputSemester2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidSemester2" runat="server" />
                    </td>
                </tr>
            </table>
            <table id="tblUomQuarter" class="dialogTable">
                <tr>
                    <td>
                        Unit of Measure Q 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomQ1" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMQ1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputQ1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidQ1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Q 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxQ1" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxQ1" MaxLength="3" Text="100" Width="50px" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxQ1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputQ1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidQ1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Q 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminQ1" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinQ1" MaxLength="3" Width="50px" Text="80" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinQ1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputQ1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidQ1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 25px;">
                        Unit of Measure Q 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomQ2" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMQ2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputQ2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidQ2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Q 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxQ2" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxQ2" MaxLength="3" Text="100" Width="50px" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxQ2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputQ2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidQ2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Q 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminQ2" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinQ2" MaxLength="3" Width="50px" Text="80" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinQ2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputQ2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidQ2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 25px;">
                        Unit of Measure Q 3
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomQ3" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMQ3" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputQ3" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidQ3" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Q 3
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxQ3" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxQ3" MaxLength="3" Text="100" Width="50px" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxQ3" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputQ3" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidQ3" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Q 3
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminQ3" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinQ3" MaxLength="3" Width="50px" Text="80" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinQ3" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputQ3" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidQ3" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 25px;">
                        Unit of Measure Q 4
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomQ4" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMQ4" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputQ4" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidQ4" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Q 4
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxQ4" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxQ4" MaxLength="3" Text="100" Width="50px" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxQ4" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputQ4" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidQ4" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Q 4
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminQ4" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinQ4" MaxLength="3" Width="50px" Text="80" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinQ4" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputQ4" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidQ4" runat="server" />
                    </td>
                </tr>
            </table>
            <table id="tblUomTriwulan" class="dialogTable">
                <tr>
                    <td>
                        Unit of Measure Triwulan 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomTriwulan1" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMTriwulan1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputTriwulan1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidTriwulan1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Triwulan 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxTriwulan1" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxTriwulan1" MaxLength="3" Text="100" Width="50px"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxTriwulan1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputTriwulan1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidTriwulan1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Triwulan 1
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminTriwulan1" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinTriwulan1" MaxLength="3" Width="50px" Text="80"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinTriwulan1" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputTriwulan1" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidTriwulan1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 25px;">
                        Unit of Measure Triwulan 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomTriwulan2" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMTriwulan2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputTriwulan2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidTriwulan2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Triwulan 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxTriwulan2" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxTriwulan2" MaxLength="3" Text="100" Width="50px"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxTriwulan2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputTriwulan2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidTriwulan2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Triwulan 2
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminTriwulan2" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinTriwulan2" MaxLength="3" Width="50px" Text="80"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinTriwulan2" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputTriwulan2" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidTriwulan2" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 25px;">
                        Unit of Measure Triwulan 3
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomTriwulan3" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMTriwulan3" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputTriwulan3" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidTriwulan3" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max Triwulan 3
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxTriwulan3" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxTriwulan3" MaxLength="3" Text="100" Width="50px"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxTriwulan3" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputTriwulan3" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidTriwulan3" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min Triwulan 3
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminTriwulan3" runat="server" ReadOnly="true" Width="250"
                            class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinTriwulan3" MaxLength="3" Width="50px" Text="80"
                            runat="server" ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinTriwulan3" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputTriwulan3" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidTriwulan3" runat="server" />
                    </td>
                </tr>
            </table>
            <table id="tblUomWeekly" class="dialogTable">
                <tr>
                    <td>
                        Unit of Measure
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomWeekly" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <button id="btn_BrowseUOMWeekly" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMInputWeekly" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomidWeekly" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Max
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uommaxWeekly" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMaxWeekly" MaxLength="3" Text="100" Width="50px" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMaxWeekly" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMaxInputWeekly" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uommaxidWeekly" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        UoM Min
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txt_uomminWeekly" runat="server" ReadOnly="true" Width="250" class="mandatory"></asp:TextBox>
                        <asp:TextBox ID="txtPrecentageMinWeekly" MaxLength="3" Width="50px" Text="80" runat="server"
                            ReadOnly="false" class="longText mandatory"></asp:TextBox>%
                        <button id="btn_BrowseUOMMinWeekly" class="ui-button ui-state-default">
                            <span class="ui-button ui-icon ui-icon-newwin"></span>
                        </button>
                        <button id="btn_BrowseUOMMinInputWeekly" class="ui-button ui-state-default">
                            setup
                        </button>
                        <input type="hidden" id="txt_uomminidWeekly" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <br />
    <table border="0">
        <tr>
            <td colspan="3">
                <br />
                <button id="btn_savemethod" class="button save" runat="server" name="btnSave">
                    Save
                </button>
                <button id="btn_closemethod" class="button close" runat="server" name="btnClose">
                    Close
                </button>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hfKpiId" runat="server" Value="" />
    <asp:HiddenField ID="hfStatusData" runat="server" Value="" />
    <div id="divBrowseUOM" class="ui-widget-content padding5px ui-corner-all">
        <table cellpadding="0" cellspacing="0" border="0" class="display" id="uom">
            <thead>
                <tr>
                    <th>
                        No
                    </th>
                    <th>
                        Description
                    </th>
                    <th>
                        is Active
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    <div id="divBrowseUOMMax" class="ui-widget-content padding5px ui-corner-all">
        <table cellpadding="0" cellspacing="0" border="0" class="display" id="uommax">
            <thead>
                <tr>
                    <th>
                        No
                    </th>
                    <th>
                        Description
                    </th>
                    <th>
                        Value
                    </th>
                    <th>
                        is Active
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    <div id="divBrowseUOMMin" class="ui-widget-content padding5px ui-corner-all">
        <table cellpadding="0" cellspacing="0" border="0" class="display" id="uommin">
            <thead>
                <tr>
                    <th>
                        No
                    </th>
                    <th>
                        Description
                    </th>
                    <th>
                        Value
                    </th>
                    <th>
                        is Active
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    <div id="divdetailInputUom">
    </div>
    <div id="divdetailInputUomDetail">
    </div>
    </form>
</body>
</html>
